package com.spzx.user.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.user.api.domain.UserAddress;
import com.spzx.user.api.fallback.UserAddressFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @ClassName UserAddressFeignClient
 * @Author 波
 * @Date 2024/8/12 17:52
 */
@FeignClient(contextId = "userAddressFeignClient", path = "/userAddress", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = UserAddressFeignClientFallbackFactory.class)
public interface UserAddressFeignClient {
    @GetMapping("/getUserAddress/{userAddressId}")
    public R<UserAddress> selectUserAddressById(@PathVariable("userAddressId") Long userAddressId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
